package com.example.demo.service;

import com.example.common.entity.CommentInfo;
import com.example.common.entity.UserInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.example.demo.mapper.CommentMapper;
import java.util.List;

@Service
public class CommentService {

    @Autowired
    private CommentMapper commentMapper;

    public Integer add(CommentInfo commentInfo) {
        return commentMapper.add(commentInfo);
    }

    public List<CommentInfo> showCommentByAid(Integer aid) {
        return commentMapper.showCommentByAid(aid);
    }

    public Integer delCommentByid(Integer id) {
        return commentMapper.delCommentById(id);
    }

    public CommentInfo getCommentInfoById(Integer id) {
        return commentMapper.getCommentInfoById(id);
    }

    public Integer updateCommentByUid(UserInfo userInfo) {
        return commentMapper.updateCommentByUid(userInfo);
    }

    public Integer getCommentsByAid(Integer aid) {
        return commentMapper.getCommentsByAid(aid);
    }

    public Integer delCommentByAid(Integer aid) {
        return commentMapper.delCommentByAid(aid);
    }

}
